package com.umbacos.udm.client.view;

import com.google.gwt.user.client.ui.Grid;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HasVerticalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootLayoutPanel;
import com.umbacos.udm.client.arch.ImageButton;
import com.umbacos.udm.client.model.View;

public class TransmissionView extends View {

	final public ImageButton btConnect=new ImageButton("images/trans.png", 100, 24, 32);
	final public HorizontalPanel hpConn = new HorizontalPanel();
	
	public TransmissionView(){

		RootLayoutPanel rlp=RootLayoutPanel.get();

		Image fileLogo = new Image("images/trans.png");
		fileLogo.setSize("24px", "24px");
		fileLogo.addStyleName("valignmiddle");

		Label fileTitle = new Label("TransmissionBT");
		fileTitle.setStyleName("viewtitle");

		Image spacer = new Image("images/transparent.gif");
		spacer.setHeight("42px");

		hpConn.setVerticalAlignment(ALIGN_MIDDLE);
		hpConn.add(btConnect);
		
		Grid grTitle = new Grid(1, 4);
		setTitle(grTitle);
		grTitle.setWidth(rlp.getOffsetWidth() - 200 + "px");
		grTitle.getRowFormatter().setVerticalAlign(0, HasVerticalAlignment.ALIGN_MIDDLE);
		grTitle.getCellFormatter().setHorizontalAlignment(0, 2, HasHorizontalAlignment.ALIGN_RIGHT);
		grTitle.getCellFormatter().setVerticalAlignment(0, 2, HasVerticalAlignment.ALIGN_MIDDLE);
		grTitle.getCellFormatter().setWidth(0, 0, "24px");
		grTitle.getCellFormatter().setWidth(0, 3, "1px");

		grTitle.setWidget(0, 0, fileLogo);
		grTitle.setWidget(0, 1, fileTitle);
		grTitle.setWidget(0, 2, btConnect);
		grTitle.setWidget(0, 3, spacer);
	}
}
